
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.spoto.oa.model.Employee" isELIgnored="false"%>
<%@ page import="com.spoto.oa.util.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		<link href="style/v1/common/welcome.css" rel="stylesheet">
		<script type="text/javascript" src="js/lib/jquery-1.4.2.js">

</script>
		<script type="text/javascript" src="js/lib/jquery.validate.js">

</script>

		<script src="js/common/list.js" type="text/javascript">

</script>
<style type="text/css">
#welcome{
margin-top:-20px;
}
</style>
	</head>

	<body>
		
		<div id="welcome">
<h1>
			导入时发生冲突的数据
		</h1>
			<%
				Object ob = request.getAttribute("employees");

				if (null != ob) {
					PageUtil pc = new PageUtil();
					String searchType = request.getParameter("searchType");
					String type = request.getParameter("op_type");
					String info = request.getParameter("infor");
					String kind=request.getParameter("conflict_op");
					pc.setCurrentPage(request.getParameter("page")); //设置当前页面
					pc.setPageCount(2); //设置每页记录数
					pc.setRecordCount(((List<Employee>) ob).size()); //设置记录条数
					pc.setPageUrl("EmployeeServlet?op_type=" + type + "&searchType="
							+ searchType + "&infor=" + info+"&conflict_op="+kind); //设置跳转页面url
					List<Employee> employees = pc.getSubList((List<Employee>) ob); //获取当前页面记录
					if (employees.isEmpty()) {
			%>
			<div id="no-exist">
				已不存在冲突数据
			</div>
			<%
				} else {
			%>
			<div id="list">
				<div class="view">
					<form action="EmployeeServlet?op_type=conflict&conflict_op=multi_del"
						method="post">
						<div id="table-ope-left">
							<input type="hidden" name="op_type" value="multi_del" />
							<button type="button" class="select_btn" name="select_all">
								全选
							</button>
							<button type="button" class="select_btn" name="select_reverse">
								反选
							</button>
							<button type="button" class="select_btn" name="select_cancel">
								取消
							</button>
							<input type="submit" id="mul-del" value="删除选中" />
						</div>
						<div id="table-ope-right">
							<%=pc.getPageJumpLinkHtml()%>
						</div>
						<div id="c"></div>
						<table class="table">
							<tr class="firstrow">
								<td>
									员工帐号
								</td>
								<td>
									员工姓名
								</td>
								<td>
									员工角色
								</td>
								<td>
									联系方式
								</td>
								<td>
									操作
								</td>
							</tr>
							<%
							int i = 0;
									for (Employee e : employees) {
										i++;
						%>


						<tr>
							<td style="text-align:left">
								<input type="checkbox" name="del-flag" value="<%=e.getUsername()%>"/>
								<a  href="EmployeeServlet?username=<%=e.getUsername()%>&top_type=conflict&conflict_op=to_update"><%
									out.print(e.getUsername());
								%></a>
								
								
							</td>
							<td>
								<%
									out.print(e.getName());
								%>
							</td>
							<td>
								<%
									if (e.getIsAdmin().equals("是")) {
								%>
								管理员
								<%
									} else if (e.getIsAdmin().equals("否")) {
								%>
								普通员工
								<%
									}
								%>
							</td>
							<td>
								<%
									out.print(e.getCell());
								%>
							</td>
							<td>
								<a
									href="EmployeeServlet?username=<%=e.getUsername()%>&op_type=conflict&conflict_op=delete"
									onclick="return isDelete()" class="delete_a">删除</a>
								<a
									href="EmployeeServlet?username=<%=e.getUsername()%>&op_type=conflict&conflict_op=to_update" class="update_a">修改</a>
							</td>
						</tr>


						<%
							}
						%>

					</table>
					</form>					
					<div class="page-no">
						<ul>
							<%=	pc.getJavaScriptJumpCode() %>
							<li id="statue">
								<%=pc.getPageCountHtml()%>
							</li>
							<li class="jump">
								<%=pc.getPageFormJumpHtml()%>
							</li>
						</ul>

					</div>					


				</div>
				<%
					}
					}
				%>
			</div>


		</div>

	</body>
</html>
